





#include <stdio.h>



class Base
{
public:
    Base() {}
    virtual ~Base() {}

    virtual void print(){
        printf("base\n");
    }
};


class Device : public Base
{
public:
    Device() {}
    virtual ~Device() {}

    virtual void print(){
        printf("Device\n");
    }
};


int main()
{
    Device d;

    Base* pb = &d;
    Device* pd = &d;

    pb->print();
    pd->print();

    return 0;
}


